import React from 'react';
import {Form, Input, Button, Select, Breadcrumb } from 'antd';
import BreadcrumbNav from '../../../../components/BreadcrumbNavBar/breadcrumbNav';

const Index = React.createClass({

  contextTypes: {
    router: React.PropTypes.object
  },

  getInitialState() {
    return {
      item: '房屋装修',
      its: {

      },
      btnTxt: '添加'
    }
  },

  componentDidMount() {
    let path = this.props.location.pathname;
    let index = '/landlord/houseResource/list';
    let title = path == index ? '添加' : '返回';
    this.setState({
      btnTxt: title
    })
  },

  handleRouter() {
    let path = this.props.location.pathname;
    let index = '/landlord/houseResource/list';
    let add = '/landlord/houseResource/add';
    let txtName = ( path == index) ? '返回' : '添加';
    let goPathUrl = ( path == index) ? add : index;
    console.log(path)
    this.context.router.push(goPathUrl);
    this.setState({btnTxt: txtName});
  },

  render () {
    return (
      <div>

          {this.props.children}
        </div>

    );
  }
});

export default Index